home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
rpg
/
crossfir.001
/
crossfir~
/
eutl
/
xmalloc
/
test1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-14
|
472b
|
33 lines
#include "xmalloc.h"
#include <stdio.h>
void toomuch()
{
unsigned long v = 1 << 20;
while(v<(1<<31)) {
xmalloc(v);
v <<= 1;
}
fprintf(stderr,"Failed to run out of memory??? Wow!\n");
exit(1);
}
main() {
xmalloc_seterf(LongJmpPrintErrorFunction);
WITH_HANDLING
toomuch();
HANDLE {
BEGIN_MATCH;
XMATCH(xmalloc,nomem) {
printf("Correctly ran out of memory\n");
}
END_MATCH;
}
END_HANDLING;
exit(0);
}